<div ng-controller="registerCtr" class="register-page container">

    <div app-top-bar attr-title="topTitle" attr-sub="login" attr-link="login"></div>

    <form name="register" class="main">
        <div class="user">
            <input type="text"
                   placeholder="例如：张三"
                   ng-pattern="/^([a-zA-Z0-9]|[\u4e00-\u9fa5]){4,10}$/"
                   ng-model="user"
                   name="user" required>
            <span>会员名</span>
            <div class="error" ng-show="register.user.$invalid">
                <i ng-show="register.user.$error.required && register.user.$touched">*用户名不能为空！</i>
                <i ng-show="register.user.$error.pattern && register.user.$touched">*用户名格式错误！</i>
            </div>
        </div>
        <div class="psw">
            <input type="password"
                   placeholder="请输入八位有效阿拉伯数字"
                   ng-pattern="/^\d{8}$/"
                   ng-model="psw"
                   name="psw" required>
            <span>密码</span>
            <div class="error" ng-show="register.psw.$invalid">
                <i ng-show="register.psw.$error.required && register.psw.$touched">*密码不能为空！</i>
                <i ng-show="register.psw.$error.pattern && register.psw.$touched">*密码格式错误！</i>
            </div>
        </div>
        <div class="verification">
            <input type="text"
                   placeholder="请输入右侧验证码"
                   ng-model="codeStr"
                   name="codeStr" ng-blur="codeBlur() " required >
            <s ng-bind="code" ng-click="changeCode()"></s>
            <div class="error" ng-show="register.codeStr.$invalid">
                <i ng-show="register.codeStr.$error.required && register.codeStr.$touched">*验证码不能为空！</i>
            </div>
            <div class="error" ng-show="register.codeStr.$valid && register.codeStr.$touched && isRightCode">验证码输入错误！</div>
        </div>
        <div class="agreement">
            <input type="checkbox" ng-model="check">
            <span ng-bind="agreement"></span>
        </div>
        <input type="submit" class="login" value="立即注册" ng-click="registerFn()">
    </form>
    <down-bars attr-title="moreType"></down-bars>
</div>